package com.chuangjiangx.member.manager.common.utils;

import com.cloudrelation.customer.product.start.Start;

/**
 * @author cj-ch
 * @date 2018/9/28 下午8:22
 */
public class StrUtils {


    public static final String encodeMobilePhone(String mobilePhone){
        if(mobilePhone == null || mobilePhone.trim().length() < 1){
            return "";
        }
        String productId = System.getProperty(Start.SYS_CUSTOMER_PRODUCT_ID_KEY);
        // 如果是创匠演示则隐藏手机号码中间4位
        if("10030".equals(productId)){
            return mobilePhone.replaceFirst("(\\d{3})(\\d+)(\\d{4})", "$1****$3");
        }
        return mobilePhone;
    }
}
